<?php
class indexModel extends Model{
		
	function fetch(){
		@list($key, $oth) = explode('Model', __CLASS__);
		$tmp[$key]['blog'] = $this->v_get_blog();
		return $tmp;
	}
	
	function v_get_blog(){
		$data = $this->field('*, t.name as name')
					->table ( 'posts', 'p' )
					//->addTable('type', 't')
					->leftJoin('type>t', array('p.type'=>'t.id'))
					->where(array('p.type'=>'1'/*, 'p.type:F'=>'t.id'*/))
					//->limit(4)
					->find ();
		//echo $this->fetchAllCount();
		/*$one = $this->findByid(1);
		print_r($one);*/
		/*$query = $this->db->query("SELECT * FROM posts");
		print_r($this->db->list_db());*/
		return $data;
	}
}
?>